<!--
 * @Description: 条件渲染
 * @Author: zzj
 * @Date: 2021-09-26 10:35:22
 * @LastEditors: zzj
 * @LastEditTime: 2021-09-26 15:56:46
-->
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>条件渲染</title>
	<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
</head>
<body>
	<div id="app">
		<button v-on:click=" type='email' ">email</button>
		<button v-on:click=" type='telephone' ">telephone</button>
		<div>
			<div class="email" v-if=" type==='email' ">
				<form action="">
					email:<input type="text" placeholder="请输入email">
				</form>
			</div>
			<div class="telephone" v-else-if=" type==='telephone' ">
				<form action="">
					telephone:<input type="text" placeholder="请输入telephone">
				</form>
			</div>
			<div v-else>
				错误!
			</div>
		</div>
	</div>

	<script>
		let vm = new Vue({
			el:"#app",
			data:{
					type:"telephone"	
			}
		})
	</script>
</body>
</html>